/**
 * @file 轨迹模块
 * @description 整合所有轨迹相关的服务和网关
 * @author Assistant
 * @date 2024-02-03
 * @updated 2024-03-09
 */

import { Module } from '@nestjs/common';
import { CoordinateService } from './services/coordinate.service';
import { GpsLogService } from './services/log-processor.service';
import { TrackGateway } from './gateways/track.gateway';
import { TrackController } from './controllers/track.controller';
import { CoordinateController } from './controllers/coordinate.controller';
import { HttpModule } from '@nestjs/axios';
import { MongooseModule } from '@nestjs/mongoose';
import { GpsLog, GpsLogSchema } from './schemas/gps-log.schema';
import { TrackService } from './services/track.service';
import { GpsLogAdapter } from './adapters/gps-log.adapter';
import { GpsLogRepository } from './repositories/gps-log.repository';
import { CoordinateFilterUtil } from './utils/coordinate-filter.util';

@Module({
  imports: [
    HttpModule,
    MongooseModule.forFeature([{ name: GpsLog.name, schema: GpsLogSchema }])
  ],
  controllers: [
    TrackController,
    CoordinateController
  ],
  providers: [
    // 服务
    CoordinateService,
    GpsLogService,
    TrackService,
    
    // 网关
    TrackGateway,
    
    // 仓库
    GpsLogRepository,
    
    // 适配器
    GpsLogAdapter,
    
    // 工具
    CoordinateFilterUtil,
  ],
  exports: [
    CoordinateService,
    GpsLogService,
    TrackGateway,
    TrackService,
    GpsLogRepository,
    CoordinateFilterUtil,
  ]
})
export class TrackModule {} 